/*******************************************************************************
 * Copyright (c) 2009 David Harrison.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl-3.0.html
 *
 * Contributors:
 *     David Harrison - initial API and implementation
 ******************************************************************************/
package com.sfs.postcodes.stripes;

/**
 *
 * @author David Harrison
 * 3 May 2008
 *
 */

import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.UrlBinding;


/**
 * The Class WebservicesActionBean.
 */
@UrlBinding("/web/webservices")
public class WebservicesActionBean extends BaseActionBean {

    /** The Constant WEBSERVICES. */
    private static final String WEBSERVICES = "webservices.jsp";

    /**
     * Gets the xmlrpc url.
     *
     * @return the xmlrpc url
     */
    public final String getXmlrpcUrl() {
        return getApplicationUrl() + "xmlrpc";
    }

    /**
     * Gets the soap url.
     *
     * @return the soap url
     */
    public final String getSoapUrl() {
        return getApplicationUrl() + "services/PostcodeService";
    }

    /**
     * Gets the wsdl url.
     *
     * @return the wsdl url
     */
    public final String getWsdlUrl() {
        return getSoapUrl() + "?wsdl";
    }

    /**
     * Gets the xsd url.
     *
     * @return the xsd url
     */
    public final String getXsdUrl() {
        return getSoapUrl() + "?xsd";
    }

    /**
     * The Details action.
     *
     * @return the resolution
     */
    @DefaultHandler
    public final Resolution details() {
        Resolution response = new ForwardResolution(getView(WEBSERVICES));

        return response;
    }
}
